package Exercise;

public class Game_test {
    public static void main(String[] args) {
        Game role1 = new Game("唐三", 100,'男');
        Game role2 = new Game("萧炎", 100,'男');
        role1.Show(role1);
        role2.Show(role2);
        while (true) {
            //被攻击者血量为0，游戏退出
            role1.attack(role2);
            if (role2.getBlood() == 0) {
                System.out.println(role1.getName() + "击败" + role2.getName());
                break;
            }
            role2.attack(role1);
            if (role1.getBlood() == 0) {
                System.out.println(role2.getName() + "击败" + role1.getName());
                break;
            }
        }
    }
}